import request from '@/utils/request'
// 渲染数据
export function gettable(params) {
  return request({
    url: 'pages',
    params

  })
}
// 回显
export function getdata(id) {
  return request({
    // url: 'pages/count'
    url: `/pages/${id}`
    // url: `/pages/8`

  })
}

// 删除
export function deldata(id) {
  return request({
    url: `/pages/${id}`,
    // url: `/categories/${id}`,
    method: 'delete'
  })
}

// 更新数据
export function updata(data) {
  return request({
    url: `/pages/${data.id}`,
    method: 'put',
    data
  })
}

// 添加
export function addData(data) {
  return request({
    url: '/pages',
    method: 'post',
    data
  })
}

// 数据条数(页码)
export function getCount(params) {
  return request({
    // url: '/pages/count?_limit=2&_start=0&title_contains=awda',
    url: '/pages/count',
    method: 'get',
    params
  })
}

